#include "snakesnake.h"

SnakeSnake::SnakeSnake(QObject *parent) :
    QObject(parent)
{

}

void SnakeSnake::killSnake()
{
    body.clear();
}

void SnakeSnake::createSnake(QList<Point> newBody)
{
    body.clear();
    foreach(Point cur, newBody)
        body.push_back(cur);
}

void SnakeSnake::move(Point newHeadPosition)
{
    body.pop_back();
    body.push_front(newHeadPosition);
}

QList<Point> SnakeSnake::getBody()
{
    return body;
}

Point SnakeSnake::getHead()
{
    return body.first();
}

void SnakeSnake::increase()
{
    body.push_back(body.last());
}

void SnakeSnake::decrease()
{
    body.pop_back();
}
